home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1568 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news text default
99% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 62 6c | 61 63 6b 2e 77 65 65 67 |Path: bl|ack.weeg|
|00000010| 2e 75 69 6f 77 61 2e 65 | 64 75 21 72 6f 62 69 6e |.uiowa.e|du!robin|
|00000020| 73 6f 6e 0a 46 72 6f 6d | 3a 20 54 68 65 20 41 6d |son.From|: The Am|
|00000030| 6f 72 70 68 6f 75 73 20 | 4d 61 73 73 20 3c 72 6f |orphous |Mass <ro|
|00000040| 62 69 6e 73 6f 6e 40 62 | 6c 75 65 2e 77 65 65 67 |binson@b|lue.weeg|
|00000050| 2e 75 69 6f 77 61 2e 65 | 64 75 3e 0a 4e 65 77 73 |.uiowa.e|du>.News|
|00000060| 67 72 6f 75 70 73 3a 20 | 63 6f 6d 70 2e 6c 61 6e |groups: |comp.lan|
|00000070| 67 2e 63 0a 53 75 62 6a | 65 63 74 3a 20 52 65 3a |g.c.Subj|ect: Re:|
|00000080| 20 61 74 6f 6c 20 6f 72 | 20 73 74 72 74 6f 6c 20 | atol or| strtol |
|00000090| 3f 0a 44 61 74 65 3a 20 | 53 75 6e 2c 20 31 34 20 |?.Date: |Sun, 14 |
|000000a0| 4a 61 6e 20 31 39 39 36 | 20 32 30 3a 35 35 3a 33 |Jan 1996| 20:55:3|
|000000b0| 33 20 2d 30 36 30 30 0a | 4f 72 67 61 6e 69 7a 61 |3 -0600.|Organiza|
|000000c0| 74 69 6f 6e 3a 20 55 6e | 69 76 65 72 73 69 74 79 |tion: Un|iversity|
|000000d0| 20 6f 66 20 49 6f 77 61 | 2c 20 49 6f 77 61 20 43 | of Iowa|, Iowa C|
|000000e0| 69 74 79 2c 20 49 41 2c | 20 55 53 41 0a 44 69 73 |ity, IA,| USA.Dis|
|000000f0| 74 72 69 62 75 74 69 6f | 6e 3a 20 77 6f 72 6c 64 |tributio|n: world|
|00000100| 0a 4d 65 73 73 61 67 65 | 2d 49 44 3a 20 3c 50 69 |.Message|-ID: <Pi|
|00000110| 6e 65 2e 41 33 32 2e 33 | 2e 39 31 2e 39 36 30 31 |ne.A32.3|.91.9601|
|00000120| 31 34 32 30 34 34 35 33 | 2e 35 39 30 35 31 44 2d |14204453|.59051D-|
|00000130| 31 30 30 30 30 30 40 62 | 6c 61 63 6b 2e 77 65 65 |100000@b|lack.wee|
|00000140| 67 2e 75 69 6f 77 61 2e | 65 64 75 3e 0a 52 65 66 |g.uiowa.|edu>.Ref|
|00000150| 65 72 65 6e 63 65 73 3a | 20 3c 34 64 62 6f 62 71 |erences:| <4dbobq|
|00000160| 24 37 36 33 40 6a 75 70 | 69 74 65 72 2e 70 6c 61 |$763@jup|iter.pla|
|00000170| 6e 65 74 2e 6e 65 74 3e | 0a 4e 4e 54 50 2d 50 6f |net.net>|.NNTP-Po|
|00000180| 73 74 69 6e 67 2d 48 6f | 73 74 3a 20 62 6c 61 63 |sting-Ho|st: blac|
|00000190| 6b 2e 77 65 65 67 2e 75 | 69 6f 77 61 2e 65 64 75 |k.weeg.u|iowa.edu|
|000001a0| 0a 4d 69 6d 65 2d 56 65 | 72 73 69 6f 6e 3a 20 31 |.Mime-Ve|rsion: 1|
|000001b0| 2e 30 0a 43 6f 6e 74 65 | 6e 74 2d 54 79 70 65 3a |.0.Conte|nt-Type:|
|000001c0| 20 54 45 58 54 2f 50 4c | 41 49 4e 3b 20 63 68 61 | TEXT/PL|AIN; cha|
|000001d0| 72 73 65 74 3d 55 53 2d | 41 53 43 49 49 0a 58 2d |rset=US-|ASCII.X-|
|000001e0| 53 65 6e 64 65 72 3a 20 | 72 6f 62 69 6e 73 6f 6e |Sender: |robinson|
|000001f0| 40 62 6c 61 63 6b 2e 77 | 65 65 67 2e 75 69 6f 77 |@black.w|eeg.uiow|
|00000200| 61 2e 65 64 75 0a 49 6e | 2d 52 65 70 6c 79 2d 54 |a.edu.In|-Reply-T|
|00000210| 6f 3a 20 3c 34 64 62 6f | 62 71 24 37 36 33 40 6a |o: <4dbo|bq$763@j|
|00000220| 75 70 69 74 65 72 2e 70 | 6c 61 6e 65 74 2e 6e 65 |upiter.p|lanet.ne|
|00000230| 74 3e 20 0a 0a 4f 6e 20 | 31 34 20 4a 61 6e 20 31 |t> ..On |14 Jan 1|
|00000240| 39 39 36 2c 20 43 68 72 | 69 73 20 4b 65 6d 70 20 |996, Chr|is Kemp |
|00000250| 77 72 6f 74 65 3a 0a 0a | 3e 20 77 68 61 74 20 69 |wrote:..|> what i|
|00000260| 73 20 74 68 65 20 64 69 | 66 66 65 72 65 6e 63 65 |s the di|fference|
|00000270| 20 62 65 74 77 65 65 6e | 20 20 73 74 72 74 6f 6c | between| strtol|
|00000280| 20 66 75 6e 63 74 69 6f | 6e 20 61 6e 64 20 61 74 | functio|n and at|
|00000290| 6f 6c 20 3f 0a 0a 20 20 | 53 74 72 74 6f 6c 20 69 |ol ?.. |Strtol i|
|000002a0| 73 20 6d 6f 72 65 20 67 | 65 6e 65 72 61 6c 2e 20 |s more g|eneral. |
|000002b0| 20 49 6e 20 61 64 64 69 | 74 69 6f 6e 20 74 6f 20 | In addi|tion to |
|000002c0| 65 78 74 72 61 63 74 69 | 6e 67 20 61 20 6c 6f 6e |extracti|ng a lon|
|000002d0| 67 20 66 72 6f 6d 20 61 | 20 0a 73 74 72 69 6e 67 |g from a| .string|
|000002e0| 2c 20 69 74 20 73 74 6f | 72 65 73 20 61 20 70 6f |, it sto|res a po|
|000002f0| 69 6e 74 65 72 20 74 6f | 20 74 68 65 20 66 69 72 |inter to| the fir|
|00000300| 73 74 20 75 6e 63 6f 6e | 76 65 72 74 61 62 6c 65 |st uncon|vertable|
|00000310| 20 63 68 61 72 61 63 74 | 65 72 20 69 6e 20 69 74 | charact|er in it|
|00000320| 73 20 0a 73 65 63 6f 6e | 64 20 70 61 72 61 6d 65 |s .secon|d parame|
|00000330| 74 65 72 2c 20 61 6e 64 | 20 61 6c 6c 6f 77 73 20 |ter, and| allows |
|00000340| 79 6f 75 20 74 6f 20 73 | 70 65 63 69 66 79 20 74 |you to s|pecify t|
|00000350| 68 65 20 62 61 73 65 20 | 6f 66 20 74 68 65 20 6e |he base |of the n|
|00000360| 75 6d 62 65 72 20 69 6e | 20 74 68 65 20 0a 74 68 |umber in| the .th|
|00000370| 69 72 64 20 61 72 67 75 | 6d 65 6e 74 2e 20 20 53 |ird argu|ment. S|
|00000380| 6f 20 66 6f 72 20 65 78 | 61 6d 70 6c 65 3a 0a 0a |o for ex|ample:..|
|00000390| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 6c 69 62 |#include| <stdlib|
|000003a0| 2e 68 3e 0a 2e 2e 2e 0a | 20 20 63 68 61 72 20 2a |.h>.....| char *|
|000003b0| 73 20 3d 20 22 31 32 33 | 41 22 2c 0a 20 20 20 20 |s = "123|A",. |
|000003c0| 20 20 20 2a 63 68 72 70 | 74 72 3b 0a 20 20 6c 6f | *chrp|tr;. lo|
|000003d0| 6e 67 20 6c 3b 0a 0a 20 | 20 6c 20 3d 20 73 74 72 |ng l;.. | l = str|
|000003e0| 74 6f 6c 28 73 2c 20 26 | 63 68 72 70 74 72 2c 20 |tol(s, &|chrptr, |
|000003f0| 31 30 29 3b 0a 2e 2e 2e | 0a 20 20 77 69 6c 6c 20 |10);....|. will |
|00000400| 73 74 6f 72 65 20 74 68 | 65 20 76 61 6c 75 65 20 |store th|e value |
|00000410| 31 32 33 4c 20 69 6e 20 | 6c 20 61 6e 64 20 73 65 |123L in |l and se|
|00000420| 74 20 63 68 72 70 74 72 | 20 74 6f 20 70 6f 69 6e |t chrptr| to poin|
|00000430| 74 20 74 6f 20 74 68 65 | 20 22 41 22 20 69 6e 20 |t to the| "A" in |
|00000440| 73 20 0a 28 73 69 6e 63 | 65 20 41 20 69 73 20 6e |s .(sinc|e A is n|
|00000450| 6f 74 20 61 20 76 61 6c | 69 64 20 64 69 67 69 74 |ot a val|id digit|
|00000460| 20 69 6e 20 62 61 73 65 | 20 31 30 29 2e 20 20 4f | in base| 10). O|
|00000470| 54 4f 48 2c 20 69 66 20 | 74 68 65 20 63 61 6c 6c |TOH, if |the call|
|00000480| 20 74 6f 20 73 74 72 74 | 6f 6c 20 69 73 3a 0a 0a | to strt|ol is:..|
|00000490| 20 20 6c 20 3d 20 73 74 | 72 74 6f 6c 28 73 2c 20 | l = st|rtol(s, |
|000004a0| 26 63 68 72 70 74 72 2c | 20 31 36 29 3b 0a 0a 20 |&chrptr,| 16);.. |
|000004b0| 20 74 68 65 6e 20 6c 20 | 67 65 74 73 20 74 68 65 | then l |gets the|
|000004c0| 20 76 61 6c 75 65 20 34 | 36 36 36 4c 20 28 31 32 | value 4|666L (12|
|000004d0| 33 41 20 69 6e 20 62 61 | 73 65 20 31 36 20 69 73 |3A in ba|se 16 is|
|000004e0| 20 34 36 36 36 20 69 6e | 20 62 61 73 65 20 31 30 | 4666 in| base 10|
|000004f0| 29 20 61 6e 64 20 0a 63 | 68 72 70 74 72 20 69 73 |) and .c|hrptr is|
|00000500| 20 73 65 74 20 74 6f 20 | 70 6f 69 6e 74 20 74 6f | set to |point to|
|00000510| 20 74 68 65 20 6e 75 6c | 20 74 65 72 6d 69 6e 61 | the nul| termina|
|00000520| 74 6f 72 20 6f 66 20 73 | 2e 20 20 49 66 20 4e 55 |tor of s|. If NU|
|00000530| 4c 4c 20 69 73 20 70 61 | 73 73 65 64 20 61 73 20 |LL is pa|ssed as |
|00000540| 0a 74 68 65 20 32 6e 64 | 20 70 61 72 61 6d 65 74 |.the 2nd| paramet|
|00000550| 65 72 20 28 69 74 20 68 | 61 73 20 74 6f 20 62 65 |er (it h|as to be|
|00000560| 20 63 61 73 74 20 74 6f | 20 28 63 68 61 72 20 2a | cast to| (char *|
|00000570| 2a 29 20 69 66 20 69 74 | 20 69 73 29 20 74 68 65 |*) if it| is) the|
|00000580| 6e 20 73 74 72 74 6f 6c | 28 29 20 0a 64 6f 65 73 |n strtol|() .does|
|00000590| 6e 27 74 20 72 65 74 75 | 72 6e 20 74 68 65 20 6c |n't retu|rn the l|
|000005a0| 61 73 74 20 75 6e 63 6f | 6e 76 65 72 74 61 62 6c |ast unco|nvertabl|
|000005b0| 65 20 63 68 61 72 61 63 | 74 65 72 20 74 68 72 6f |e charac|ter thro|
|000005c0| 75 67 68 20 69 74 2e 20 | 3a 29 0a 0a 20 20 46 69 |ugh it. |:).. Fi|
|000005d0| 6e 61 6c 6c 79 2c 20 61 | 74 6f 6c 28 73 29 20 69 |nally, a|tol(s) i|
|000005e0| 73 20 74 68 65 20 73 61 | 6d 65 20 61 73 20 73 74 |s the sa|me as st|
|000005f0| 72 74 6f 6c 28 73 2c 20 | 28 63 68 61 72 20 2a 2a |rtol(s, |(char **|
|00000600| 29 4e 55 4c 4c 2c 20 31 | 30 29 2e 0a 0a 2f 2a 2a |)NULL, 1|0).../**|
|00000610| 4a 61 6d 65 73 20 52 6f | 62 69 6e 73 6f 6e 2a 2a |James Ro|binson**|
|00000620| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000630| 2a 2a 2a 2a 2a 20 20 20 | 20 20 20 20 20 20 20 20 |***** | |
|00000640| 20 0a 20 20 22 49 66 20 | 61 20 66 61 74 61 6c 20 | . "If |a fatal |
|00000650| 65 72 72 6f 72 20 6f 63 | 63 75 72 73 2c 20 74 68 |error oc|curs, th|
|00000660| 65 20 70 72 6f 67 72 61 | 6d 20 73 68 6f 75 6c 64 |e progra|m should|
|00000670| 20 6e 6f 74 20 62 65 20 | 61 6c 6c 6f 77 65 64 20 | not be |allowed |
|00000680| 74 6f 20 63 6f 6e 74 69 | 6e 75 65 2e 22 0a 20 2d |to conti|nue.". -|
|00000690| 2d 20 4f 72 61 63 6c 65 | 20 50 72 6f 2a 43 20 55 |- Oracle| Pro*C U|
|000006a0| 73 65 72 27 73 20 47 75 | 69 64 65 20 20 20 20 20 |ser's Gu|ide |
|000006b0| 20 20 20 20 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a | ****|********|
|000006c0| 2a 6a 61 6d 65 73 2d 72 | 6f 62 69 6e 73 6f 6e 40 |*james-r|obinson@|
|000006d0| 75 69 6f 77 61 2e 65 64 | 75 2a 2a 2f 0a |uiowa.ed|u**/. |
+--------+-------------------------+-------------------------+--------+--------+